package pl.puntin.punclient.messages;

public final class LoginMessage extends Message
{

	private final String login;

	public LoginMessage(final String login)
	{
		this.login = login;
	}

	@Override
	public byte getType()
	{
		return MessageTypes.C_LOGIN;
	}

	@Override
	public byte[] getByteForm()
	{
		byte[] byteForm = new byte[getLenght()];
		byteForm[0] = getType();
		for (int i = 0; i < login.length(); i++)
		{
			byteForm[i+1] = (byte) login.charAt(i);
		}
		return byteForm;
	}

}
